package com.yilin.tms.core.entity.order.payment;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yilin.tms.core.commons.base.BaseDataEntity;
import com.yilin.tms.core.commons.base.BaseEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

@Entity
@Table(name = "service_payment_cost")
@TableName(value = "service_payment_cost")
public class ServicePaymentCost extends BaseEntity {

    /**
     * 付款状态
     */
    public enum PayStatus {
        verify(0, "审核中"),//付款审批中
        fail(1, "失败"),//付款审批失败，不允许付款
        approved(2, "已审批，等待付款"),//付款审批完成
        wait(3, "等待中"),//付款已通过，即将付款
        success(4, "付款成功");


        @EnumValue
        public Integer index;
        public String name;

        PayStatus(Integer index, String name) {
            this.index = index;
            this.name = name;
        }
    }

    /**
     * 当前平台类型
     * */
    public enum ServicePlatType{
        whPlat(0, "网货平台"),
        fhPlat(1, "孵化平台");

        @EnumValue
        public Integer index;
        public String name;

        ServicePlatType(Integer index, String name) {
            this.index = index;
            this.name = name;
        }
    }

    /**
     * 服务费类型
     * */
    public enum ServiceFeeType{
        operateFee(0, "运营服务费"),
        technicalFee(1, "技术服务费");

        @EnumValue
        public Integer index;
        public String name;

        ServiceFeeType(Integer index, String name) {
            this.index = index;
            this.name = name;
        }
    }

    @Column(name = "service_plat_type")
    private ServicePlatType servicePlatType;//
    @Column(name = "service_plat_id")
    private String servicePlatId;//当前运营平台
    @Column(name = "service_plat_name")
    private String servicePlatName;//网货>孵化    孵化>易林

    @Column(name = "superior_plat_id")
    private String superiorPlatId;//上级平台 收款
    @Column(name = "superior_plat_name")
    private String superiorPlatName;//上级平台

    //订单
    @Column(name = "source_order_no")
    private String sourceOrderNo;//订单， 运营服务费：清算单号    技术服务费： 本地交易流水单号
    @Column(name = "source_order_id")
    private String sourceOrderId;//订单， 运营服务费：清算ID    技术服务费： 本地交易记录id

    @Column(name = "service_fee_type")
    private ServiceFeeType serviceFeeType;//服务费类型

    @Column(name = "operate_fee")
    private Double operateFee;

    @Column(name = "technical_fee")
    private Double technicalFee;

    @Column(name = "service_cost")
    private Double serviceCost; ///+++
    // 基本支付数据
    @Column(name = "pre_payment_no")
    private String prePaymentNo ;//预付单号
    @Column(name = "pay_status")
    private PayStatus payStatus;//支付状态
    @Column(name = "trade_no")
    private String tradeNo;//支付单号(平台流水号)
    @Column(name = "pay_remark")
    private String payRemark;//付款说明
    // 付款操作人
    @Column(name = "initiate_user_id")
    private String initiateUserId;//付款发起人 create:zjy 2022/8/3
    @Column(name = "initiate_user_name")
    private String initiateUserName;//付款发起人名称 create:zjy 2022/8/3
    @Column(name = "opt_user_id")
    private String optUserId;//付款操作人ID create:zjy 2022/8/3
    @Column(name = "opt_user_name")
    private String optUserName;//付款操作人名称 create:zjy 2022/8/3
    // 第三方支付数据
    @Column(name = "payment_type_name")
    private String paymentTypeName;//支付银行/平台名称
    @Column(name = "bank_flow_no")
    private String bankFlowNo;//银行流水号（银行/第三方)
    @Column(name = "payment_capital_account")
    private String paymentCapitalAccount;//付款资金账号/卡号/微信ID/支付宝ID 等
    @Column(name = "income_capital_account")
    private String incomeCapitalAccount;//收款资金账号/卡号/微信ID/支付宝ID 等
    @Column(name = "payment_safe_code")
    private String paymentSafeCode;//新增安全码，用于通知结果时验证支付结果安全
    // 时间线
    @Column(name = "pay_create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date payCreateTime;
    @Column(name = "pay_complete_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date payCompleteTime;



    public Double getOperateFee() {
        return operateFee;
    }

    public void setOperateFee(Double operateFee) {
        this.operateFee = operateFee;
    }

    public Double getTechnicalFee() {
        return technicalFee;
    }

    public void setTechnicalFee(Double technicalFee) {
        this.technicalFee = technicalFee;
    }

    public ServicePlatType getServicePlatType() {
        return servicePlatType;
    }

    public void setServicePlatType(ServicePlatType servicePlatType) {
        this.servicePlatType = servicePlatType;
    }

    public String getServicePlatId() {
        return servicePlatId;
    }

    public void setServicePlatId(String servicePlatId) {
        this.servicePlatId = servicePlatId;
    }

    public String getServicePlatName() {
        return servicePlatName;
    }

    public void setServicePlatName(String servicePlatName) {
        this.servicePlatName = servicePlatName;
    }

    public String getSuperiorPlatId() {
        return superiorPlatId;
    }

    public void setSuperiorPlatId(String superiorPlatId) {
        this.superiorPlatId = superiorPlatId;
    }

    public String getSuperiorPlatName() {
        return superiorPlatName;
    }

    public void setSuperiorPlatName(String superiorPlatName) {
        this.superiorPlatName = superiorPlatName;
    }

    public String getSourceOrderNo() {
        return sourceOrderNo;
    }

    public void setSourceOrderNo(String sourceOrderNo) {
        this.sourceOrderNo = sourceOrderNo;
    }

    public String getSourceOrderId() {
        return sourceOrderId;
    }

    public void setSourceOrderId(String sourceOrderId) {
        this.sourceOrderId = sourceOrderId;
    }

    public ServiceFeeType getServiceFeeType() {
        return serviceFeeType;
    }

    public void setServiceFeeType(ServiceFeeType serviceFeeType) {
        this.serviceFeeType = serviceFeeType;
    }

    public Double getServiceCost() {
        return serviceCost;
    }

    public void setServiceCost(Double serviceCost) {
        this.serviceCost = serviceCost;
    }

    public String getPrePaymentNo() {
        return prePaymentNo;
    }

    public void setPrePaymentNo(String prePaymentNo) {
        this.prePaymentNo = prePaymentNo;
    }

    public PayStatus getPayStatus() {
        return payStatus;
    }

    public void setPayStatus(PayStatus payStatus) {
        this.payStatus = payStatus;
    }

    public String getTradeNo() {
        return tradeNo;
    }

    public void setTradeNo(String tradeNo) {
        this.tradeNo = tradeNo;
    }

    public String getPayRemark() {
        return payRemark;
    }

    public void setPayRemark(String payRemark) {
        this.payRemark = payRemark;
    }

    public String getInitiateUserId() {
        return initiateUserId;
    }

    public void setInitiateUserId(String initiateUserId) {
        this.initiateUserId = initiateUserId;
    }

    public String getInitiateUserName() {
        return initiateUserName;
    }

    public void setInitiateUserName(String initiateUserName) {
        this.initiateUserName = initiateUserName;
    }

    public String getOptUserId() {
        return optUserId;
    }

    public void setOptUserId(String optUserId) {
        this.optUserId = optUserId;
    }

    public String getOptUserName() {
        return optUserName;
    }

    public void setOptUserName(String optUserName) {
        this.optUserName = optUserName;
    }

    public String getPaymentTypeName() {
        return paymentTypeName;
    }

    public void setPaymentTypeName(String paymentTypeName) {
        this.paymentTypeName = paymentTypeName;
    }

    public String getBankFlowNo() {
        return bankFlowNo;
    }

    public void setBankFlowNo(String bankFlowNo) {
        this.bankFlowNo = bankFlowNo;
    }

    public String getPaymentCapitalAccount() {
        return paymentCapitalAccount;
    }

    public void setPaymentCapitalAccount(String paymentCapitalAccount) {
        this.paymentCapitalAccount = paymentCapitalAccount;
    }

    public String getIncomeCapitalAccount() {
        return incomeCapitalAccount;
    }

    public void setIncomeCapitalAccount(String incomeCapitalAccount) {
        this.incomeCapitalAccount = incomeCapitalAccount;
    }

    public String getPaymentSafeCode() {
        return paymentSafeCode;
    }

    public void setPaymentSafeCode(String paymentSafeCode) {
        this.paymentSafeCode = paymentSafeCode;
    }

    public Date getPayCreateTime() {
        return payCreateTime;
    }

    public void setPayCreateTime(Date payCreateTime) {
        this.payCreateTime = payCreateTime;
    }

    public Date getPayCompleteTime() {
        return payCompleteTime;
    }

    public void setPayCompleteTime(Date payCompleteTime) {
        this.payCompleteTime = payCompleteTime;
    }
}
